/**
 * 大乐透订单模板类
 * @version 1.1.4
 */
class DltTplModel {

	/**
	 * 返回完整的文件模板
	 * @param {Object} data 
	 * @returns 
	 */
	getTplForFileData(data = {}) {
		return Object.assign({
			// 上期开奖结果
			PrevDrawalInfo: {
				lotteryDrawNum: 25098,
				lotteryDrawResult: "",
				lotteryDrawTime: ""
			},
			// 本期开奖结果
			DrawalInfo: {
				lotteryDrawNum: 25099,
				lotteryDrawResult: "",
				lotteryDrawTime: ""
			},
			// 统计信息
			StatInfo: {},
			// 订单数据
			OrderList: []
		}, data);
	}

	/**
	 * 返回全局统计模板
	 * @returns 
	 */
	getTplForStatInfo(data = {}) {
		return Object.assign({
			totalBatchCount: 0, // 总批次数量
			batchTicketCount: 0, // 每批次投注数量
			totalTicketCount: 0, // 总注数
			profitBatchCount: 0, // 盈利批次量
			lossBatchCount: 0, // 亏损批次量
			profitBatchCountRate: 0, // 盈利批次量比例
			lossBatchCountRate: 0, // 亏损批次量比例
			winBatchCount: 0, // 有中奖批次量
			noWinBatchCount: 0, // 无中奖批次量
			winBatchCountRate: 0, // 有中奖批次量比例
			noWinBatchCountRate: 0, // 无中奖批次量比例
			totalIncome: 0, // 总收入金额
			totalExpenses: 0, // 总支出金额
			netProfitMoney: 0, // 净收入金额
			// 最高奖项
			maxPrize: {
				value: 0,
				text: '未中奖',
				front: 0,
				back: 0,
				money: 0,
				moneyText: '无'
			},
			// 各奖项详情
			prize1: {
				title: '一等奖',
				prizeMoney: 0, // 奖项奖金
				totalBatchCount: 0, // 总批数
				totalTicketCount: 0, // 总注数
				totalIncome: 0, // 总收入金额
				list: [], // 明细
			},
			prize2: {
				title: '二等奖',
				prizeMoney: 0,
				totalBatchCount: 0,
				totalTicketCount: 0,
				totalIncome: 0,
				list: [],
			},
			prize3: {
				title: '三等奖',
				prizeMoney: 0,
				totalBatchCount: 0,
				totalTicketCount: 0,
				totalIncome: 0,
				list: [],
			},
			prize4: {
				title: '四等奖',
				prizeMoney: 0,
				totalBatchCount: 0,
				totalTicketCount: 0,
				totalIncome: 0,
				list: [],
			},
			prize5: {
				title: '五等奖',
				prizeMoney: 0,
				totalBatchCount: 0,
				totalTicketCount: 0,
				totalIncome: 0,
				list: [],
			},
			prize6: {
				title: '六等奖',
				prizeMoney: 0,
				totalBatchCount: 0,
				totalTicketCount: 0,
				totalIncome: 0,
				list: [],
			},
			prize7: {
				title: '七等奖',
				prizeMoney: 0,
				totalBatchCount: 0,
				totalTicketCount: 0,
				totalIncome: 0,
				list: [],
			},
			prize8: {
				title: '八等奖',
				prizeMoney: 0,
				totalBatchCount: 0,
				totalTicketCount: 0,
				totalIncome: 0,
				list: [],
			},
			prize9: {
				title: '九等奖',
				prizeMoney: 0,
				totalBatchCount: 0,
				totalTicketCount: 0,
				totalIncome: 0,
				list: [],
			}
		}, data);
	}

	/**
	 * 
	 * @param {Object} data 
	 * @returns 
	 */
	getTplForOrderListItem(data = {}) {
		return Object.assign({
			id: 0,
			remark: "",
			param: {
				chooseMode: '', // 选号模式：初选/优选
				poolType: '', // 号源类型：frontAndBack/columns/xcolumns-h1h1/xcolumns-h1h2/xcolumns-h2h1/xcolumns-h2h2
				filterLevel: '', // 选号池过滤：1/2/3
				buildBy: '', // 选号方式：定时任务/人工选号/AI选号/机器选号
				blackNums: '', // 号码排除：号码黑名单，号码之间以空格隔开，前后区以逗号隔开
			},
			drawList: [],
			list: [
				// "03 13 11 11 21 08 12"
			],
			ticketQuantity: 0, // 投注数量
			totalExpenses: 0, // 总支出
			totalIncome: 0, // 总收入
			netProfitMoney: 0, // 净利润
			maxPrize: { // 最高奖项
				value: 0,
				text: "未中奖",
				front: 0,
				back: 0,
				money: 0,
				moneyText: "-"
			},
		}, data);
	}

	/**
	 * 返回所有参数合集
	 * 
	 * 推荐方案：【初选/7列选号池/过滤2】、【初选/前后区选号池/过滤3】、【优选/7列选号池/过滤2】、【优选/前后区选号池/过滤3】中奖率最佳。
	 * 
	 * @param {string} chooseMode 选号模式：初选/优选
	 * @param {string} poolType 号源类型：frontAndBack/columns/xcolumns-h1h1/xcolumns-h1h2/xcolumns-h2h1/xcolumns-h2h2
	 * @param {string} filterLevel 选号池过滤：1/2/3
	 * @param {string} buildBy 选号方式：定时任务/人工选号/AI选号/机器选号
	 * @param {string} blackNums 号码排除：号码黑名单，号码之间以空格隔开，前后区以逗号隔开
	 * @returns 
	 */
	getAllTplParams(blackNums = '') {
		return [{
				id: 'CF1',
				chooseMode: '初选',
				poolType: 'frontAndBack',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CF2',
				chooseMode: '初选',
				poolType: 'frontAndBack',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CF3',
				chooseMode: '初选',
				poolType: 'frontAndBack',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YF1',
				chooseMode: '优选',
				poolType: 'frontAndBack',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YF2',
				chooseMode: '优选',
				poolType: 'frontAndBack',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YF3',
				chooseMode: '优选',
				poolType: 'frontAndBack',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CC1',
				chooseMode: '初选',
				poolType: 'columns',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CC2',
				chooseMode: '初选',
				poolType: 'columns',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CC3',
				chooseMode: '初选',
				poolType: 'columns',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YC1',
				chooseMode: '优选',
				poolType: 'columns',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YC2',
				chooseMode: '优选',
				poolType: 'columns',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YC3',
				chooseMode: '优选',
				poolType: 'columns',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH1H11',
				chooseMode: '初选',
				poolType: 'xcolumns-h1h1',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH1H12',
				chooseMode: '初选',
				poolType: 'xcolumns-h1h1',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH1H13',
				chooseMode: '初选',
				poolType: 'xcolumns-h1h1',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH1H11',
				chooseMode: '优选',
				poolType: 'xcolumns-h1h1',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH1H12',
				chooseMode: '优选',
				poolType: 'xcolumns-h1h1',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH1H13',
				chooseMode: '优选',
				poolType: 'xcolumns-h1h1',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH1H21',
				chooseMode: '初选',
				poolType: 'xcolumns-h1h2',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH1H22',
				chooseMode: '初选',
				poolType: 'xcolumns-h1h2',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH1H23',
				chooseMode: '初选',
				poolType: 'xcolumns-h1h2',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH1H21',
				chooseMode: '优选',
				poolType: 'xcolumns-h1h2',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH1H22',
				chooseMode: '优选',
				poolType: 'xcolumns-h1h2',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH1H23',
				chooseMode: '优选',
				poolType: 'xcolumns-h1h2',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH2H11',
				chooseMode: '初选',
				poolType: 'xcolumns-h2h1',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH2H12',
				chooseMode: '初选',
				poolType: 'xcolumns-h2h1',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH2H13',
				chooseMode: '初选',
				poolType: 'xcolumns-h2h1',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH2H11',
				chooseMode: '优选',
				poolType: 'xcolumns-h2h1',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH2H12',
				chooseMode: '优选',
				poolType: 'xcolumns-h2h1',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH2H13',
				chooseMode: '优选',
				poolType: 'xcolumns-h2h1',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH2H21',
				chooseMode: '初选',
				poolType: 'xcolumns-h2h2',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH2H22',
				chooseMode: '初选',
				poolType: 'xcolumns-h2h2',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'CCH2H23',
				chooseMode: '初选',
				poolType: 'xcolumns-h2h2',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH2H21',
				chooseMode: '优选',
				poolType: 'xcolumns-h2h2',
				filterLevel: 1,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH2H22',
				chooseMode: '优选',
				poolType: 'xcolumns-h2h2',
				filterLevel: 2,
				buildBy: '机器选号',
				blackNums
			},
			{
				id: 'YCH2H23',
				chooseMode: '优选',
				poolType: 'xcolumns-h2h2',
				filterLevel: 3,
				buildBy: '机器选号',
				blackNums
			},
		];
	}

	getParamPoolTypeText(poolType) {
		return {
			"frontAndBack": "前区和后区号码池",
			"columns": "7列号码池",
			"xcolumns-h1h1": "7列号码池-前半前半",
			"xcolumns-h1h2": "7列号码池-前半后半",
			"xcolumns-h2h1": "7列号码池-后半前半",
			"xcolumns-h2h2": "7列号码池-后半后半",
		} [poolType] || poolType;
	}

	getParamText(param) {
		return `${param.chooseMode}/${this.getParamPoolTypeText(param.poolType)}/过滤${param.filterLevel}`;
	}

	ChooseModeData = [{
		text: '初选',
		value: '初选'
	}, {
		text: '优选',
		value: '优选'
	}];

	PoolTypeData = [{
		text: '前区和后区号码池',
		value: 'frontAndBack'
	}, {
		text: '7列号码池',
		value: 'columns'
	}, {
		text: '7列号码池-前半前半',
		value: 'xcolumns-h1h1'
	}, {
		text: '7列号码池-前半后半',
		value: 'xcolumns-h1h2'
	}, {
		text: '7列号码池-后半前半',
		value: 'xcolumns-h2h1'
	}, {
		text: '7列号码池-后半后半',
		value: 'xcolumns-h2h2'
	}];

	FilterLevelData = [{
		text: '1',
		value: '1'
	}, {
		text: '2',
		value: '2'
	}, {
		text: '3',
		value: '3'
	}];
}

export default DltTplModel;